package com.liruo.srpingframework.dataaccess.transaction.customize;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

public class ProxyAnnotationTransactionAttributeSourceBeanProcessorImportBeanDefinitionRegistrar implements
    ImportBeanDefinitionRegistrar {
    //BeanDefinitionRegistryPostProcessor
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
        BeanDefinitionRegistry registry) {
      RootBeanDefinition beanDefinition = new RootBeanDefinition();
      beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
      beanDefinition.setBeanClass(ProxyAnnotationTransactionAttributeSourceBeanProcessor.class);
      registry.registerBeanDefinition("proxyAnnotationTransactionAttributeSourceBeanProcessor", beanDefinition);
    }
  }